project(xncc_platform)

# include compile macro
include(../head.cmake)

# include dir
include_directories(./shared/inc)
include_directories(./msg_list/inc)
include_directories(./cfg_mgr/inc)
include_directories(./foundation/inc)
include_directories(./user_if/inc)
include_directories(./error_mgr/inc)
include_directories(../xncc_log/include)

# link dir
# link_directories()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)

# add source file
aux_source_directory(./shared/src/ SRC_FILES)
aux_source_directory(./msg_list/src/ SRC_FILES)
aux_source_directory(./cfg_mgr/src/ SRC_FILES)
aux_source_directory(./foundation/src/ SRC_FILES)
aux_source_directory(./user_if/src/ SRC_FILES)

link_directories(../xncc_log/lib)

# libname
add_library(${PROJECT_NAME} STATIC ${SRC_FILES})

set(INC_LIB ${CMAKE_CURRENT_SOURCE_DIR}/../lib)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/lib ${INC_LIB})
